{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import subprocess"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For Linux / MAC Users\n",
    "result = subprocess.run(\n",
    "    [\"env\"],\n",
    "    capture_output=True,\n",
    "    text=True\n",
    ")\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For windows Users\n",
    "result = subprocess.run(\n",
    "    [\"set\"],\n",
    "    capture_output=True,\n",
    "    text=True,\n",
    "    shell = True\n",
    ")\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For Linux / Mac Users\n",
    "result = subprocess.run(\n",
    "    [\"env\"],\n",
    "    capture_output=True,\n",
    "    text=True,\n",
    "    env={\"SERVER\": \"OTHER_SERVER\"}\n",
    ")\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For Windows Users\n",
    "result = subprocess.run(\n",
    "    [\"set\"],\n",
    "    capture_output=True,\n",
    "    text=True,\n",
    "    shell = True,\n",
    "    env={\"SERVER\": \"OTHER_SERVER\"}\n",
    ")\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For Linux / MAC Users \n",
    "import os\n",
    "result = subprocess.run(\n",
    "    [\"env\"],\n",
    "    capture_output=True,\n",
    "    text=True,\n",
    "    env={**os.environ, \"SERVER\": \"OTHER_SERVER\"}\n",
    ")\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For windows users\n",
    "import os\n",
    "result = subprocess.run(\n",
    "    [\"set\"],\n",
    "    capture_output=True,\n",
    "    text=True,\n",
    "    shell = True,\n",
    "    env={**os.environ, \"SERVER\": \"OTHER_SERVER\"}\n",
    ")\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
